# Maintainer: Daniel M. Capella <polyzen@archlinux.org>
# Maintainer: Alexander Epaneshnikov <alex19ep@archlinux.org>
# Contributor: Christoph Brill <egore911@gmail.com>

_name=pytesseract
pkgname=python-pytesseract
pkgver=0.3.13
pkgrel=1
pkgdesc='Python wrapper for Google Tesseract'
arch=('any')
url=https://github.com/madmaze/pytesseract
license=('Apache')
depends=('python-packaging' 'python-pillow' 'tesseract')
makedepends=(
  'git'
  'python-build'
  'python-installer'
  'python-setuptools'
  'python-wheel'
)
checkdepends=('python-pytest' 'tesseract-data-eng' 'tesseract-data-fra')
source=("git+$url.git#tag=v$pkgver")
b2sums=('SKIP')

build() {
  cd $_name
  python -m build --wheel --skip-dependency-check --no-isolation
}

check() {
  cd $_name
  python -m venv --system-site-packages test-env
  test-env/bin/python -m installer dist/*.whl
  test-env/bin/python -m pytest
}

package() {
  cd $_name
  python -m installer --destdir="$pkgdir" dist/*.whl
}

# vim:set ts=2 sw=2 et:
